package cn.xizikelif.basic.controller;

import cn.xizikelif.basic.service.IVerifyCodeService;
import cn.xizikelif.basic.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/verifyCode")
public class VerifyCodeController {

        @Autowired
        private IVerifyCodeService codeService;


    @GetMapping("/image/{imageCodeKey}")
    public AjaxResult verifyCodeImage(@PathVariable("imageCodeKey") String imageCodeKey){
        String baes64 = codeService.garph(imageCodeKey);

        return AjaxResult.me().setResultObj(baes64);
    }

}
